// undoor.txt - replaces the door script with a non-door version (unopenable door).
//
// Memory Cells - <none>
//

beginterrainscript;

variables;

short choice, x;

body;

beginstate INIT_STATE;
break;

beginstate START_STATE;
break;

beginstate SEARCH_STATE;
	message_dialog("The door locked up tight and jammed.", "Judging from its appearance, it doesn't look like you can open it.");
break;

beginstate BLOCK_MOVE_STATE;
	reset_dialog();
	add_dialog_str(0, "The door is jammed tight and probably can't be opened.", 0);
	if (get_flag(50, 8) == 0) {
		add_dialog_str(1, "In amongst the dust, cobwebs and old newspapers, you spot what looks like a journal.", 0);
		add_dialog_str(2, "You are able to grab it with a little difficulty.", 0);
		x = 3;
	}
	else {
		add_dialog_str(1, "You are able to pry it open enough to see dust, cobwebs and broken furniture.", 0);
		x = 2;
	}
	add_dialog_str(x, "Doesn't look like the family is behind this door though.", 0);
	add_dialog_choice(0, "Ok");
	choice = run_dialog(0);
	// give initial journal
	if (get_flag(50, 8) == 0) {
		set_flag(50, 8, 1);
		reward_give(457);
		award_party_xp(100, 25);
	}
break;

beginstate UNLOCK_SPELL_STATE;
	print_str_color("Your unlock door spell fizzles.", 2);
break;

beginstate DISPEL_BARRIER_STATE;
	print_str_color("Dispel Barrier: The spell fails to affect this door.", 2);
break;
